package com.quartz;



import java.util.Date;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;


/**
 * <一句话功能简述> <功能详细描述>
 *
 * @author honny.huang
 * @version [版本号, 2011-3-14]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */

public class QuartzTest implements Job
{
	 private static Logger logger = Logger.getLogger(QuartzTest.class);  
	 public void execute(JobExecutionContext jobContext) throws JobExecutionException
	 {
        try
        {
        	logger.info("Enter QuartzTest.execute()");
        	System.out.println("In SimpleQuartzJob - executing its JOB at "   
  	                + new Date() + " by " + jobContext.getTrigger().getName()); 
            // 调用方法执行任务
	        this.test();
	        logger.info("Exit QuartzTest.execute()");
        }
        catch (Exception e)
        {
        	logger.error("调用test任务错误.[" + new Date() + "]," + e.getMessage());
        }
	 }
	 
	 public void test()
	 {
		 System.out.println("==============");
		 System.out.println("quartz配置测试");
		 System.out.println("==============");
	 }
	
}
